package com.day13.JVM;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class ExceptionDemo03 {
    public static void main(String[] args) {
        System.out.println("main方法开始");
        try {
            method2();
        }catch (ParseException e){
            e.printStackTrace();
        }
        System.out.println("main方法结束");
    }
    public static void method2() throws ParseException {
        String s="2048-08-09";
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        Date d=sdf.parse(s);
        System.out.println(d);
    }
    public static void method()throws ArrayIndexOutOfBoundsException{
        int[] arr={1,2,3};
        String s="2048-08-09";
        System.out.println(arr[3]);
    }
}
